﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonForm.aspx.cs" Inherits="FantastPlatform.Community.UI.PersonForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var ap = new FantastPlatform.UI.AddPersonForm({
            renderTo: 'psf_div',
            Id: '<%=GetId() %>',
            HouseId: '<%=GetHouseId() %>',
            PersonType: '<%=GetPersonType() %>',
            ParentFrom: bp,
            url: '../Service/PersonService.aspx?Action=AddBusinessPerson',
            tbar: [{
                text: '完成',
                iconCls: 'save',
                handler: function () {
                    if (typeof (bp.BusinessPersonEditGrid) == 'undefined') {
                        submitPanelJson1(ap, currtWind, null);
                    } else {
                        submitPanelJson1(ap, currtWind, bp.BusinessPersonEditGrid);
                    } 
               //     submitFormJson(ap, bp.BusinessPersonEditGrid, currtWind);

                }
            }, '-', {
                text: '重置',
                iconCls: 'cancel',
                handler: function () { ap.form.reset(); }
            }, '-', {
                text: '自动填写',
                iconCls: 'save',
                tooltip: {
                    text: '根据身份证号码自动填写信息',
                    title: '根据身份证号码自动填写信息',
                    autoHide: true
                },
                handler: function () {
                    if (ap.form.getValues().IdCard)
                        ap.form.load({
                            url: '../Service/PersonService.aspx?Action=GetByIdCard',
                            params: { id: ap.Id, IdCard: ap.form.getValues().IdCard },
                            waitMsg: '正在读取数据...',
                            waitTitle: '请稍后...',
                            failure: function (form, action) {
                                if (action.failureType != 'client') {
                                    showErrorMessage('操作失败', action.result.message, '');
                                }
                            }
                        });
                }
            }]

        })

  
    </script>
</head>
<body>
    <div id="psf_div">
    </div>
</body>
</html>
